{% extends 'TopxiaWebBundle:CourseManage:layout.html.twig' %}

{% block title %}{{'课程订单查询'|trans}} - {{ parent() }}{% endblock %}

{% set side_nav = 'course_manage_order' %}
{% set script_controller = 'course-manage/order' %}

{% block main %}

<div class="panel panel-default panel-col course-data">
	<div class="panel-heading">{{'课程订单查询'|trans}}
		{% if app.user.isAdmin() or setting('course.teacher_search_order') == 1 %}
			<a class="btn btn-info btn-sm pull-right mhs" href="{{ path('course_manage_order_export_csv', {id:course.id,
			startDateTime:app.request.query.get('startDateTime'),
			endDateTime:app.request.query.get('endDateTime'),
			status:request.get('status'),
			payment:request.get('payment'),
			keywordType:request.get('keywordType'),
			keyword:request.get('keyword')}) }}"><i class="glyphicon glyphicon-export"></i> {{'导出订单'|trans}}</a>
		{% endif %}
	</div>
	<div class="panel-body">
		<form id="user-search-form" class="form-inline well well-sm" action="" method="get" novalidate>
			<div class="mbm">
				{{'创建时间'|trans}} :
				<div class="form-group">
		    		<input class="form-control" type="text" id="startDate" name="startDateTime" value="{{app.request.query.get('startDateTime')}}" placeholder="{{'起始时间'|trans}}">
				</div>
				<div class="form-group">-</div>
				<div class="form-group">
				    <input class="form-control" type="text" id="endDate" name="endDateTime" value="{{app.request.query.get('endDateTime')}}" placeholder="{{'结束时间'|trans}}">
				</div>
			</div>

			<div>
				{{'筛选条件'|trans}} :
				<div class="form-group">
					<select class="form-control" name="status">
						{{ select_options(dict('orderStatus'), request.get('status'), '订单状态'|trans) }}
					</select>
				</div>

				<div class="form-group">
					<select class="form-control" name="payment">
						{% set options = {'':'支付方式'|trans,'alipay':'支付宝'|trans,'wxpay':'微信支付'|trans,'none':'其他支付'|trans} %}
						{{ select_options(options, request.get('payment')) }}
					</select>
				</div>

				<span class="divider"></span>

	    		<div class="form-group">
	      			<select class="form-control" name="keywordType">
	        			{% set options = {sn: '订单号'|trans, buyer:'购买者用户名'|trans} %}
	        			{{ select_options(options, request.get('keywordType')) }}
	      			</select>
	    		</div>

	    		<div class="form-group">
	      			<input class="form-control" type="text" name="keyword" value="{{ request.get('keyword') }}" placeholder="{{'关键词'|trans}}">
	    		</div>

				<button class="btn btn-primary">{{'搜索'|trans}}</button>
			</div>
		</form>

		<table class="table table-striped table-hover" id="order-table">
	    	{% include 'TopxiaWebBundle:Order:order-table.html.twig' with {mode:'course'} %}
	  	</table>
		{{ web_macro.paginator(paginator) }}
	</div>
</div>

{% endblock %}



